/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.component.gateway.core.http;

import info.peigen.hotpot.component.gateway.core.http.enums.HttpType;
import info.peigen.hotpot.component.gateway.core.http.request.HttpRequest;
import okhttp3.MediaType;

/**
 * <b>(HttpClient)</b>
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2019-05-28
 */
@SuppressWarnings("unused")
public interface HttpClient {
    MediaType JSON            = MediaType.parse("application/json; charset=utf-8");
    MediaType TEXT            = MediaType.parse("text/plain");
    MediaType XML             = MediaType.parse("application/xml; charset=utf-8");
    MediaType FORM            = MediaType.parse("application/x-www-form-urlencoded; charset=utf-8");
    int       CONNECT_TIMEOUT = 1000;
    int       READ_TIMEOUT    = 3000;
    String    HEADER          = "header";
    String    BODY            = "body";

    /**
     * 发送http请求
     *
     * @param request 请求
     *
     * @return String 响应
     *
     * @throws Exception e
     */
    String send(HttpRequest request) throws Exception;

    /**
     * Content Type
     *
     * @return HttpType
     */
    HttpType httpType();

}